<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import="java.util.List"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<title>我的日记</title>
<link rel="stylesheet" type="text/css"
	href="layui-v2.6.8/layui/css/layui.css" />
<style type="text/css">
.layui-layout-body {
	overflow-y: auto;
}

#type {
	width: 110px;
	height: 40px;
	border: 0px;
	border-radius: 5px;
	text-align: center;
	background-color: #009688;
	color: white;
	margin-left: 50px;
}
</style>
</head>
<body>
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<div class="layui-logo layui-hide-xs layui-bg-black"><%=session.getAttribute("name").toString() %>的MyDaily</div>
			<!-- 头部区域（可配合layui 已有的水平导航） -->
			<ul class="layui-nav layui-layout-left">

				<li class="layui-nav-item layui-hide-xs"><a href="home.jsp" id="my">编写日记</a></li>
				<li class="layui-nav-item layui-hide-xs"><a href="" id="my"
					style="color: royalblue;">我的日记</a></li>
				<li class="layui-nav-item layui-hide-xs"><a href="PiceterServlet">我的相册</a></li>
				<li class="layui-nav-item"><a href="javascript:;">更多</a>
					<dl class="layui-nav-child">
						<dd>
							<a href="#"
								onclick="if(window.confirm('很抱歉，该功能暂未开放，敬请等待,')==false) return false">记事本</a>
						</dd>
						<dd>
							<a href=""
								onclick="if(window.confirm('很抱歉，该功能暂未开放，敬请等待,')==false) return false">备忘录</a>
						</dd>
					</dl></li>
			</ul>
			<ul class="layui-nav layui-layout-right">
				<li class="layui-nav-item layui-hide layui-show-md-inline-block">
					<a href="" id="geren"> <img
						src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg"
						class="layui-nav-img"> 个人中心
				</a>
				</li>
				<li class="layui-nav-item layui-hide layui-show-md-inline-block">
					<a href="javascript:;">设置</a>
					<dl class="layui-nav-child">
						<dd>
							<a href=""></a>
						</dd>
						<dd>
							<a href="#" id="moshi" onclick="qiehuan()">日间模式</a>
						</dd>
						<dd>
							<a href="userQuit">退出</a>
						</dd>
					</dl>
				</li>
			</ul>
		</div>

		<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-nav-tree" lay-filter="test">
					<li class="layui-nav-item layui-nav-itemed"><a class=""
						href="javascript:;">历史日记</a>
						<dl class="layui-nav-child">
							<dd><dd><a href="PageServlet?sid=2">最近一周</a></dd>
								<dd><a href="PageServlet?sid=3">最近一月</a></dd>
								<dd><a href="PageServlet?sid=4">最近一年</a></dd>
								<dd><a href="PageServlet?sid=5">更久</a></dd>
						</dl></li>
					<li class="layui-nav-item"><a href="javascript:;">历史相册</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;">最近一周</a>
							</dd>
							<dd>
								<a href="javascript:;">最近一月</a>
							</dd>
							<dd>
								<a href="javascript:;">最近一年</a>
							</dd>
							<dd>
								<a href="">更久</a>
							</dd>
						</dl></li>
				</ul>
			</div>
		</div>

		<div class="layui-body">
			<!-- 内容主体区域 -->
			<div style="padding: 15px;">
				<span style="font-size: 20px;">
					友情提示，该功能没有修改日记的功能，删除的日记无法还原，请谨慎选择 </span> 
					<form action="PageServlet?sid=6" method="post">
					<br>
							<input type="text" id="" value="" name="query" placeholder="请输入查询日记的关键字" style="height: 40px;width: 200px;" required="required"/>
							<input type="submit" value="搜     索" style="width: 90px;height: 45px;"/>
						</form>
					 </span>
				<span> <%
 if (request.getAttribute("error") != null) {
 %> <%=request.getAttribute("error")%> <%
 }
 %>
				</span>
				<div class="cont" style="margin-top: 50px;">
					<table border="" cellspacing="" cellpadding="">
						<c:forEach items="${list }" var="list">
							<tr>
								<td>
									<div class="text">
										<br> <span class="name" style="font-size: 20px;">${ list.name}</span>
										<br> <br> <span class="data"
											style="font-size: 15px;">${ list.date}</span> <br> <br>
										<span class="type" style="font-size: 15px;">${ list.type}</span>
										<br> <br>
										<div style="font-size: 20px; width: 1500px;">${ list.diary}
										</div>
										<br> <a href="DeleteDaily?sid=${list.id }"
											onclick="if(window.confirm('您确定删除该条数据吗？')==false) return false"
											style="font-size: 20px; color: blue;">删除</a>
									</div>
								</td>
							</tr>
						</c:forEach>
					</table>
					<!-- 分页 -->
					<div id=""
						style="margin-top: 40px; font-size: 30px;">
						<form action="PageServlet?sid=${id}" method="post">
							<h3>第 ${pageList[0].pageNum } 页 / 共 ${pageList[0].pageCount }
								页 / 总共 ${pageList[0].pageSum } 条数据</h3>
							<a href="PageServlet?page=1&sid=${id} ">首页</a> <a
								href="PageServlet?page=${pageList[0].pageNum-1}&sid=${id} ">上一页</a> <a
								href="PageServlet?page=${pageList[0].pageNum+1}&sid=${id} ">下一页</a> <a
								href="PageServlet?page=${pageList[0].pageCount}&sid=${id} ">尾页</a> <span
								style="margin-left: 30px;">到第</span><input type="text" id=""
								value="" name="page" style="width: 50px; height: 28px;" />页 <input
								type="submit" value="确定"
								style="margin-left: 30px; border: 1px; width: 60px; font-size: 20px; height: 33px;" />
						</form>
					</div>
				</div>
			</div>

		</div>
		<script src="layui-v2.6.8/layui/layui.js" type="text/javascript"
			charset="utf-8"></script>
		<script>
			//JS
			layui
					.use(
							[ 'element', 'layer', 'util' ],
							function() {
								var element = layui.element, layer = layui.layer, util = layui.util, $ = layui.$;

								//头部事件
								util
										.event(
												'lay-header-event',
												{
													//左侧菜单事件
													menuLeft : function(othis) {
														layer.msg('展开左侧菜单的操作',
																{
																	icon : 0
																});
													},
													menuRight : function() {
														layer
																.open({
																	type : 1,
																	content : '<div style="padding: 15px;">处理右侧面板的操作</div>',
																	area : [
																			'260px',
																			'100%' ],
																	offset : 'rt' //右上角
																	,
																	anim : 5,
																	shadeClose : true
																});
													}
												});

							});
			// 日间/夜间切换
			function qiehuan() {
				alert("很抱歉，该功能暂未开放，敬请等待")
			}
		</script>
</body>
</html>
